<template>
  <div
    class="agent__list_item cursor"
    @click="clickAgentItem(item)">
    <img class="agent__icon" :src="item.icon" alt="" />
    <div class="agent__info">
      <p class="title fs-14">{{ item.name }}</p>
      <p class="desc fs-12 fs-c-7 mt-4">{{ item.desc }}</p>
    </div>
  </div>
</template>

<script>
export default {
  name: 'AgentListItem',
  inject: ['clickAgentItem'],
  props: {
    item: {
      type: Object,
      default: () => {}
    }
  },

  methods: {
  }
}
</script>

<style lang="scss" scoped>
.agent__list_item {
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid transparent;
  &:hover {
    background: rgba(255,255,255,0.2);
    border: 1px solid #4E5FFF;
    .agent__info .desc {
      color: #fff;
    }
  }
}
.agent__icon {
  width: 44px;
  height: 44px;
  border-radius: 9px;
}
.agent__info {
  line-height: 1.32;
  .title {
    font-weight: bold;
  }
  .desc {
    line-height: 18px;
    color: rgba(255,255,255,0.7);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* 限制显示的行数为2 */
    overflow: hidden; /* 隐藏超出部分 */
    text-overflow: ellipsis; /* 超出部分显示省略号 */
    white-space: normal; /* 允许文本正常换行（但在达到行数限制后会截断） */
  }
}
</style>
